#!/bin/sh

SRC_DIR="/dir1"
DST_DIR="/dir2"

inotifywait -mrq --format '%f' -e create ${SRC_DIR} | while read file
do
  enscript -p /tmp/output.ps ${SRC_DIR}/$file
  ps2pdf /tmp/output.ps ${DST_DIR}/${file%.*}.pdf
done
